using System.ComponentModel.DataAnnotations;

namespace AiQiuQuan.Sport.Model.Models
{
    /// <summary>
    /// 新增教练星级dto
    /// </summary>
    public class CoacherStarAddDto : IValidatableObject
    {
        /// <summary>
        /// 教练用户ID
        /// </summary>
        [Required(ErrorMessage = "教练用户ID必填")]
        public Guid CoacherUserId { get; set; }

        /// <summary>
        /// 星级
        /// </summary>
        [Required(ErrorMessage = "星级必填")]
        public int Star { get; set; }

        /// <summary>
        /// validate
        /// </summary>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (Star <= 0)
            {
                yield return new ValidationResult("星级为0");
                yield break;
            }
        }
    }
}
